package com.jy.appmarket.receiver;

import com.jy.appmarket.screenlock.service.LockerService;
import com.jy.appmarket.service.NotificationService;
import com.jy.appmarket.service.PollService;
import com.jy.appmarket.service.UpdateService;
import com.jy.appmarket.utils.LogUtil;
import com.jy.appmarket.utils.WidgetIconUtils;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * 类说明：
 * 
 * @author Baker.li
 * @date 2014年3月11日
 * @version 1.0
 */

public class BootReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		LogUtil.i("BootupBroadcastReceiver", "------------>phone boot completed!");
		// if(!NotificationService.isServiceRunning(context)){
		// NotificationService.startNotificationService(context, 10);
		// }

		// if(!PollService.isServiceRunning(context)){
		// PollService.startPollService(context);
		// }
		WidgetIconUtils.getInstance().initWidgetCacheFromAssetsIfNecessary(context);
		PollService.startPollService(context);
		NotificationService.startNotificationService(context, 10);
		UpdateService.startUpdateService(context);
		if (!LockerService.isServiceRunning(context)) {
			LockerService.startService(context);
		}
	}
}
